package cn.jeeweb.modules.client.style;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class CacheUtil {
    private static ConcurrentHashMap<String, Object> cacheMap =null;

    public static Object getCache(String key) {
        if (cacheMap==null){
            cacheMap = new ConcurrentHashMap<>();
        }
        Object obj = cacheMap.get(key);
        if(obj==null){
            cacheMap.put(key,new HashMap<>());
            return cacheMap.get(key);
        }else{
            return obj;
        }
    }

    public static void putCache(String key, Object value) {
        cacheMap.put(key, value);
    }

    public static void removeCache(String key) {
        cacheMap.remove(key);
    }

}
